package com.ddwl.user.dao.model;

import com.ddwl.schema.model.Location;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.mongodb.core.index.GeoSpatialIndexType;
import org.springframework.data.mongodb.core.index.GeoSpatialIndexed;
import org.springframework.data.mongodb.core.mapping.Document;

import javax.persistence.Id;
import java.time.Instant;

/**
 * @author Fu Zhaohui
 * @date 2015/5/9
 * 蓝牙设备
 */
@Setter
@Getter
@Document(collection = "sys_device")
public class Device {

    /**
     * ID
     */
    @Id
    private String id;
    /**
     * 平台 android or ios
     */
    private String platform;
    /**
     * 图标
     */
    private String icon;
    /**
     * 用户ID
     */
    private String userId;
    /**
     * 小孩ID
     */
    private String childrenId;
    /**
     * 设备UUID
     */
    private String uuid;
    /**
     * 别名
     */
    private String alias;
    /**
     * mac地址
     */
    private String mac;
    /**
     * 衣服类型
     */
    private Integer clothesType;

    /**
     * 备注
     */
    private String remark;
    /**
     * 是否选中
     */
    private Integer selected;

    @GeoSpatialIndexed(type = GeoSpatialIndexType.GEO_2DSPHERE)
    private Location loc;

    /**
     * 连接状态
     */
    private Integer connected;

    /**
     * 上线时间
     */
    private Instant gmtOnline;

    /**
     * 离线时间
     */
    private Instant gmtOffline;

    /**
     * 创建时间
     */
    private Instant gmtCreated;
    /**
     * 修改时间
     */
    private Instant gmtModified;
}
